﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static CSharp.Study.PLinqTest.PLinqData;

namespace CSharp.Study.PLinqTest
{
    public class Test1
    {
        public static void Go()
        {
            var ids = new HashSet<int>() { 1, 3, 5 };

            Action<Book> action = x =>
            {
                if (ids.Contains(x.Id))
                    x.Price = 9999.0m;
            };

            Books.AsParallel().ForAll(action);
        }
    }
}
